package com.itheima04;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;

public class ClientTCPDemo {
    public static void main(String[] args) throws IOException {
        // 创建客户端 socket
        Socket s = new Socket("127.0.0.1", 10000);

        // 获取输出流，写数据
        OutputStream os = s.getOutputStream();
        os.write("hello.tcp.123".getBytes());

        // 关闭
        s.close();

    }
}
